/*
 * EnemySpawner.h
 *
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses 
 */

#ifndef ENEMYSPAWNER_H_
#define ENEMYSPAWNER_H_

#include "Spawner.h"
#include "Enemy.h"
#include "ModelConstants.h"
#include "SharedConstants.h"
#include "Identifiable.h"

// Spawn de enemigos

class EnemySpawner: virtual public Representable,
                    virtual public Identifiable,
                    public Spawner {
private:
    ModelObject enemy_type;
    bool spawned;

public:
    EnemySpawner(ModelObject type, int x, int y);
    EnemySpawner(ModelObject type, int id, int x, int y);
    // Devuelve true si el lugar donde spawnea está libre, false en caso
    // contrario
    virtual bool canSpawn(Map& map);
    // Devuelve un nuevo enemigo, generado según el tipo que se recibió en el
    // constructor
    virtual LivingObject* spawn();
    // Devuelve true si ya ha generado al enemigo, false en caso contrario
    virtual bool isDepleted();
    EnemySpawner* clone();
    ModelObject getRepresentation();
    ModelObject getModelObject();
};

#endif /* ENEMYSPAWNER_H_ */
